//	ID : pallab81
// 	PROG : 417
// 	LANG : C++
// 	2011-07-07-13.02.59 Thursday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>

using namespace std;
#define fo(i,ed) for( int i = 0; i < ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define mk make_pair
#define pb push_back
#define f first
#define s second
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()

map<string, int > mp;
char buff[100];

inline void build(){
    mp.clear();
    queue< string >q;

    q.push( "" );
    int num=0;
    while( q.empty() == false ){
        string peak = q.front();
        q.pop();

            char st = LN(peak) < 1 ? 'a' : peak[ LN(peak)-1 ]+1 ;
            for(char i=st ; i<='z' ; ++i ){
                string tmp = peak+i;
                if(LN(tmp)<=5){
                    ++num;
                    mp[ tmp ] = num ;
                    q.push( tmp );
                }
            }
    }
}
int main(){
    build();
    while( gets(buff) ){
            printf("%d\n", mp[ (string) buff ] );
    }
return 0;
}

